<!--
 * @Author: your name
 * @Date: 2021-04-25 09:13:45
 * @LastEditTime: 2021-04-25 19:41:01
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \day8\myapp\src\views\About.vue
-->
<template>
  <div class="about">
    <h1>简介 ---柱状图---</h1>

  <div ref="echarts" class="simpleDemo"></div>
  </div>
</template>

<script>
 import * as echarts from 'echarts';
require('echarts/theme/macarons');
  export default {
    name: 'max',
    data() {
      return {
        chart: null,
        option:  {
          tooltip: {},
          xAxis: {
            data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
          },
          yAxis: {},
          series: [{
            name: '销量',
            type: 'bar',
            data: [10, 20, 36, 46, 40, 20],

          }
          ],
          color: ['#66FF99'],
        }
      }
    },
    mounted() {
      this.getPage()
    },
    methods: {
      getPage() {
        this.chart = echarts.init(this.$refs.echarts);
        // 使用刚指定的配置项和数据显示图表。
        this.chart.setOption(this.option);
      }
    }
  }
</script>

<style scoped>
  .simpleDemo {
    width: 390px;
    height:400px;
    float: left;
    margin: 0 auto;
  }
</style>